<%--
  Created by IntelliJ IDEA.
  author: Jsonor
  date: 2018/3/20 16:28
  description: country
--%>
<%@ page contentType="text/html;charset=UTF-8" isELIgnored="false" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
  <title>Title</title>
</head>
<style>
  *{
    padding:0;
    margin:0;
    border: 0;
  }
  table{

    text-align: center;
    margin: 2% auto;
    border-collapse: collapse;
  }
  th{
    background-color:#f8f8f8;
    height: 35px;
  }
  th:nth-child(1){
    width: 6%;
  }
  th:nth-child(3){
    width: 14%;
  }
  th:nth-child(7){
    width: 10%;
  }
  th,td,table{
    border: 1px solid #dddddd;
  }
  a{
    text-decoration: none;
    color: #2aabd2;
  }
  td{
    height: 35px;
  }

</style>

<body>
<h1 align="center">城市信息</h1>
<div align="center">
<form action="${pageContext.request.contextPath}/findByCountryName.do" >
  <input type="text " name="region" >
  <input type="submit" value="搜索">
</form>
</div>

<div align="center">
  <a href="${pageContext.request.contextPath}/view/insert.jsp">添加</a>
</div>
<table>
  <tbodey>
    <tr>
      <td>id</td>
      <td>Name</td>
      <td>CountCode</td>
      <td>District</td>
      <td>population</td>
      <td>Function</td>
    </tr>

    <c:forEach items="${country}" var="item" varStatus="Status">
      <tr>
        <td>${Status.index+1}</td>
        <td>${item.name}</td>
        <td>${item.code}</td>
        <td>${item.region}</td>
        <td>${item.population}</td>
        <td><a href="${pageContext.request.contextPath}/findByCode.do?code=${item.code}">修改</a> | <a href="${pageContext.request.contextPath}/delete.do?code=${item.code}">删除</a></td>
      </tr>
    </c:forEach>

  </tbodey>
</table>
</body>
</html>
